<template>
	<view class="">
		<block v-if="type != 'decorationMoneyExchange' && type != 'marketingCampaign' &&  type != 'newHouseAcceptance' && (offer == 1 || offer == 2 && getters.chat_offer_current) || source == 2 " >
			<view class="bottom_box_offer">
				<button class="btn" @click="onPop(3)">加入报价系统</button>
			</view>
		</block>
		<block v-else>
			<view class="bottom_box" v-if="type != 'decorationMoneyExchange' && type != 'marketingCampaign' &&  type != 'newHouseAcceptance'">
				<view class="left">
					<view class="row" @click="onOperation(2,infoObj.is_collect == 1 )">
						<image src="https://xiaoqu.wuguoxin.vip/uploads/web/GKE0onhRAublBcECEMLlS2nmNNbLUClCpsTf1UVq.png" mode="scaleToFill" v-if="infoObj.is_collect == 1"></image>
						<image src="https://xiaoqu.wuguoxin.vip/uploads/web/HGX699CQRyjEfx2UIIqk4Wwt4PYirEoLySNMIbWY.png" mode="scaleToFill" v-else></image>
						<text>收藏</text>
					</view>
					<view class="row" @click="onChatRoom(infoObj.shopping_id)" v-if="duihuanm != 3">
						<image src="../static/image/icon/news02.png" style="width: 34rpx;" mode="scaleToFill"></image>
						<text>咨询</text>
					</view>
				</view>
				<view class="right" v-if="duihuanm == 3">
					<button class="btn1" @click="onChatRoomgeren(infoObj.users_id)">在线咨询</button>
					<button class="btn2" @click="getzixunCode(infoObj.users_id,infoObj.name)">加急发送短信(1毛钱)</button>
				</view>
				<view class="right" v-if="duihuanm != 3">
					<button class="btn1"  v-if="duihuanm == 0" @click="onPop(1)">加入精算单</button>
					<button :class="duihuanm == 0 ? 'btn2':'btn3'" @click="onPop(2)">立即购买</button>
				</view>
			</view>
			<view class="bottom_box" v-else>
				<view class="left left2" >
					<view class="row" @click="onChatRoom(infoObj.shopping_id)">
						<image src="../static/image/icon/news02.png" style="width: 34rpx;" mode="scaleToFill"></image>
						<text>咨询</text>
					</view>
				</view>
				<view class="right">
					<button class="btn3" @click="onPop(2)">立即购买</button>
				</view>
			</view>
		</block>
		<!-- 弹窗 start -->
		<u-popup v-model="popup.visible" mode='bottom' closeable >
			<view class="popup_box">
				<view class="icon" @click="popup.visible = false">
					<n-icon name="close" size="38" color="#666" ></n-icon>
				</view>
				<view class="top_box">
					<view class="left">
						<image @click="onImg()" :src="popup.sku && Object.keys(popup.sku).length > 0 &&  popup.sku['pic'] ? popup.sku['pic'] :  infoObj  && infoObj.carousel && infoObj.carousel.length > 0 ? infoObj.carousel[0] :''" mode="scaleToFill"></image>
					</view>
					
					<view class="right" >
						<view class="text1" >
							¥ {{popup.gjMoneyAll}}
						</view>
						<view class="text2" v-if='popup.sku && Object.keys(popup.sku).length > 0 '>
							库存：{{ popup.sku['stock']}}
						</view>
						<view class="jijiadanwei">
							计价单位：{{infoObj['unit']}}
						</view>
						<view class="jijiadanwei " v-if='goodsname != ""'>
							已选择：{{goodsname}}
						</view>
					</view>
				</view>
				<!-- <view class="youhui" v-if='availableIntegraC != 0'>
					优惠：装修金抵扣立减{{availableIntegraC}}元
				</view>
				<view class="youhui" v-if='yunshops == 1 && tc_ratio != 0 && infoObj.type == 4'>
					预计可得提成￥{{tc_ratio}}元
				</view> -->
				<scroll-view scroll-y="true" class="specifications"  >
					<view class="list" v-if="type != 'findCraftsman' && popup.info && popup.info.attrs">
						<view class="row" v-for='(row,i) in popup.info.attrs' :key='i'>
							<view class="title">
								{{row.key}}
							</view>
							<view class="label">
								<view class="text" @click="changeLabel(row.key,i,label,il)" v-for='(label,il) in row.value' :class="popup.label[i] == label ?'active':''" :key='il'>{{label}} 
									<!-- <text v-if="!popup.info || label.stock <= 0" class="stock">缺货</text> -->
								</view>
							</view>
						</view>
					</view>
					<!-- gj -->
					<view class="list" v-else>
						<block v-if='popup.gjInfo.gongyi && popup.gjInfo.gongyi.length > 0'>
							<view class="row" >
								<view class="title">
									 施工项目
								</view>
								<view class="label" >
									<view style="margin-right: 44rpx;" >										
										<text class="text" style="margin-right: 0;"  :class="popup.gjSelect[0] == 0+1 ?'active':''">{{popup.gjInfo.classify.name}} 
										</text>
										
									</view>
								</view>
							</view>
						</block>
						<block v-if='popup.gjInfo.cl_show && popup.gjInfo.cl_show.length > 0'>
							<view class="row"  v-for='(row,i) in popup.gjInfo.cl_show'>
								<view class="title">
									 {{row.name}}
								</view>
								<view class="label" >
									<text class="text" v-for='(bn,ib) in row.brand' @click="changeLabelGJ(2,i+'_' + ib,bn,ib)" :key='ib'  :class="popup.gjSelect[i+1] == ib+1 ?'active':''" >{{bn.name}} 
									</text>
								</view>
							</view>
						</block>
					</view>
					<!-- 判断购买数量是否显示 -->
					<!-- <view class="num_box" v-if='type == "decorationMoneyExchange" || type == "buildingMaterialsCity"' > -->
					<view class="num_box" v-if='true' >
						<view class="left">
							购买数量
						</view>
						<view class="right">
							<text class="text" @click="changeNum(1)">-</text>
							<input class="text2" type="number" v-model="popup.num" @blur='changeNum(3)'/>
							<text class="text"  @click="changeNum(2)">+</text>
						</view>
					</view>
					<view class="house" v-else @click="onHouse()">
						<view class="left">
							使用房屋
						</view>
						<view class="right">
							<text v-if='houseObj' class="text ">{{ houseObj.name}}{{(houseObj.address)}}</text>
							<text v-else class="text text2">请添加房屋档案</text>
							<n-icon name="right" size="30" color="#ccc"></n-icon>
						</view>
					</view>
					<view class="supervision" v-if="!(type == 'newHouseAcceptance' || type == 'thirdPartySupervision' || type == 'decorationMoneyExchange' || type == 'marketingCampaign' || type == 'findDesign' || type == 'buildingMaterialsCity')">
						<view class="left" @click="goGongyi(popup.gjInfo.gongyi[0].content)" >
							<text>施工标准</text>
							<image src="https://xiaoqu.wuguoxin.vip/uploads/web/WQ8EB93iFXUcnuBhoRnxkpU0qynBTnZV0X6uwHe3.png" mode="scaleToFill"></image>
						</view>
						<view class="right" v-if="!(type == 'findCraftsman')">
							<text class="money">¥{{supervisor}}</text>
							<view @click="changeSupervision()"  >
								<n-icon name="squarecheckfill" size="40" color="#FD7A22"  v-if='popup.supervision == 1'></n-icon>
								<n-icon name="squarecheckfill" v-else size="40" color="#b5b5b5" ></n-icon>
							</view>
						</view>
					</view>
				</scroll-view>
				<view class="button_box">
					<button class="btn" :loading="loading" @click='onSave()' v-if='type != "findCraftsman"' :class="popup.sku && Object.keys(popup.sku).length > 0 && popup.sku['stock'] == 0 ? 'btn_d':''">确定</button>
					<button class="btn" :loading="loading" @click='onSaveGJ()' v-else>确定</button>
				</view>
			</view>
		</u-popup>
		<!-- 弹窗 end -->
	</view>
</template>

<script>
	import {setLikeCollection,setShopCartAdd,setOfferAdd} from "@/utils/postRequest.js"
	import uPopup from "@/components/u-popup.vue"
	import  { gzGoodsSku,getIMAccid,getzixunSmsCode } from "@/utils/getRequest.js"
	export default {
		props:{
			info: {
				type: Object,
				default:()=>{}
			},
			status:{
				type:String,
				default:''
			},
			type:{
				type:String, // buildingMaterialsCity、findDesign、findCraftsman、decorationMoneyExchange
				default:''
			},
			shopaid:{
				type:[String,Number],
				default:0
			},
			source:{
				type:[String,Number],
				default:0
			},
			duihuan:{
				type:[String,Number], // buildingMaterialsCity、findDesign、findCraftsman、decorationMoneyExchange
				default:''
			},
			yunshop:{
				type:[String,Number], // buildingMaterialsCity、findDesign、findCraftsman、decorationMoneyExchange
				default:0
			},
			goodssku:{
				type:[String,Number], // buildingMaterialsCity、findDesign、findCraftsman、decorationMoneyExchange
				default:0
			},
			offer:{
				type:[String,Number],
				default:''
			}
		},
		components: {
			uPopup
		},
		data(){
			return{
				mode:1,
				popup:{ // 
					visible:false,
					num:1,
					supervision:2,
					sku:{},
					label:[],
					row:[],
					labelName:[],
					gjInfo:{}, // 工匠
					gjSelect:[],
					gjMoney:[],
					gjMoneyAll:0,
					loading:false,
				},
				duihuanm:0,
				shopaids:0,
				yunshops:0,
				loading:false,
				availableIntegraC:0,
				tc_ratio:0,
				goodsname:'',
				goddname:[],
				// houseObj:null,
				loading1:false,
				infoObj:null,
				goumai:0,
				date: new Date().getTime(),//现在时间
				xuanxiang:0,
				chatLoading:false,
				loadingduanxin:false,//短信用
				
			}
		},
		watch:{
			// choiceHouse(x){ // 20211207需求变更
			// 	this.houseObj  = x
			// 	setTimeout(()=>{
			// 		var money = 0
			// 		this.popup.gjMoney.forEach((c,i)=>{
			// 			money = this.$global.formatFloat(money,Number(c),1)
			// 		})
			// 		this.popup.gjMoneyAll = this.$global.formatFloat(money,this.houseObj.centiare,3)
			// 		this.$forceUpdate()
			// 	})
			// }
		},
		computed:{
			choiceHouse(){
				return this.$store.state.choiceHouse
			},
			houseObj(){
				return this.$store.state.defaultHouse
			},
			findDesignPrice(){
				if(this.type == 'findDesign' && this.popup.sku  && Object.keys(this.popup.sku).length > 0){
					return this.$global.formatFloat(this.popup.sku['price'] ,this.houseObj ? this.houseObj.centiare : 1,3)
				}else{
					return 0
				}
			},
			supervisor(){
				console.log(this.type,this.popup.num,"<========>",this.infoObj.config_amount)
				// buildingMaterialsCity 建材成   findDesign 设计师   findCraftsman工匠  decorationMoneyExchange 装修金商城  marketingCampaign 营销
				if(this.type == 'buildingMaterialsCity'){
					 return this.$global.formatFloat(this.popup.num,this.infoObj.config_amount,3)
				}else if(this.type == 'findCraftsman' || this.type == 'findDesign' ){
					 // return this.$global.formatFloat(this.houseObj ? this.houseObj.centiare : 1,this.infoObj.config_amount,3)
					 return this.$global.formatFloat(this.popup.num,this.infoObj.config_amount,3)  //20220228修改
				}else{
					return 0
				}
			}
		},
		created(){
			this.duihuanm = this.duihuan;
			this.shopaids = this.shopaid;
			this.yunshops = this.yunshop;
			console.log(this.duihuanm,'入口判断');
			this.infoObj = this.info;
			console.log(this.infoObj,'商品详情页');
			
			//判断秒杀活动
			if(this.infoObj['type'] == 2){
				console.log(this.date,'当前时间');
				
				this.date = this.date.toString();
				this.date = this.date.slice(0,10).valueOf();
				console.log(this.date,'当前时间');
				
				if(this.date < this.infoObj['start_timeint']){
					this.goumai = 1;
				}
				if(this.date > this.infoObj['end_timeint']){
					this.goumai = 2;
				}
				console.log(this.goumai,'时间大小');
			}
			if(this.type == 'findCraftsman'){
				this.popup.supervision = 1
				this.getSkuGJInfo()
				
			}else{
				console.log(this.infoObj.sku,'商品分类');
				if(this.infoObj.sku.sku.length > 0){
					
					this.xuanxiang = 1;
					this.popup.info = this.infoObj.sku
					this.popup.label = this.popup.info.attrs.map(c=> null)
					this.popup.labelName = this.popup.info.attrs.map(c=> c['key'])
					
					console.log(this.popup.info.attrs,'商品分类2');
				}else{
					this.tc_ratio = this.infoObj.tc_ratio;
					this.xuanxiang = 2;
					this.popup.gjMoneyAll = this.infoObj['amount_x'];
					this.popup.info = this.infoObj.sku;
					this.popup.label = '';
					this.popup.labelName = '';
				}
				
			}
		},
		methods: {
			//发送短信通知
			async getzixunCode(id,goodsname) {
				if(this.$store.getters.userInfo.amount < 0.1){
					uni.showToast({
						title: '当前余额不足，请充值',
						icon: 'none',
						duration:2000
					})
					uni.navigateTo({
						url: `/pagesMy/myProfit/index`
					})
				}
				
				var res = await getIMAccid({id,statustype:2})
				console.log(res,'发送短信')
				if (!res.phone) return uni.showToast({
					title: '要发送的对象未绑定手机号，无法发送',
					icon: 'none'
				})
				let phone = res.phone;
				if(this.loadingduanxin == false){
					this.loadingduanxin = true;
					//要发送的手机号，当前用户名称，咨询商品
					var result = await getzixunSmsCode({phone:phone,username:this.$store.getters.userInfo.name,goodsname:goodsname})
					
					console.log(result,'发送短信2')
					uni.showToast({
						title: '发送成功',
						icon: 'none'
					})
					this.loadingduanxin = false;
				}else{
					uni.showToast({
						title: '请等上一个短信通知发送成功',
						icon: 'none'
					})
				}
				
				
			},
			goGongyi(row){
				console.log(row,'商品分类2');
				// var = 
				// row.forEach((c,ci)=>{ //{}
				// 	console.log(row,'商品分类2');
				// })
				uni.setStorageSync('gonyishuoming',row);
				uni.navigateTo({
					url: `/pagesHome/richTextDetails?title=${'工艺工法'}&type=typeClick`
				})
			},
			onRule(){
				uni.navigateTo({
					url: `/pagesHome/richTextDetails?title=${'监理验收'}&type=5`
				})
			},
			async onOperation(type, flag) {
				if(this.type == 'thirdPartySupervision' || this.type == 'newHouseAcceptance') return unis.showToast({title:'暂未开通',icon:'none'})
				if(!this.$store.getters.userInfo){
					return this.$global.getUserInfo()
				}
				if (type != 3) {
					if (this.loading) return
					this.loading1 = true
					try {
						var res = await setLikeCollection({
							flag: flag,
							status: type,
							id: this.infoObj.id,
							type: this.type == 'findCraftsman' ? 10 : 9
						})
						this.loading1 = false
						if (type == 1) {
							if (flag) {
								this.infoObj.is_like = 2
								this.infoObj.like = Number(this.infoObj.like) - 1
							} else {
								this.infoObj.is_like = 1
								this.infoObj.like = Number(this.infoObj.like) + 1
							}
						} else {
							if (flag) {
								this.infoObj.is_collect = 2
								this.infoObj.collect = Number(this.infoObj.collect) -1
							} else {
								this.infoObj.is_collect = 1
								this.infoObj.collect = Number(this.infoObj.collect) + 1
							}
						}
			
					} catch {
						uni.showToast({title:'操作失败',icon:'none'})
						this.loading1 = false
					}
				} else {
					uni.showToast({
						title: '暂未开通',
						icon: 'none'
					})
				}
			
			},
			
			onHouse(){
				if(!this.houseObj){
					uni.showToast({title:'请添加房屋档案',icon:'none'})
					uni.navigateTo({
						url:'/pagesMy/housingArchives/detail?status=1'
					})
				}
			},
			async onSaveGJ(){
				console.log('选项2');
				if(!this.houseObj) return uni.showToast({title:'请选择房屋',icon:'none'})
				if(!this.popup.gjMoneyAll) return uni.showToast({title:'请选择商品/施工项目',icon:'none'})
				var params = {
							goods_id:this.infoObj.id,
							goods_sku:JSON.stringify(this.popup.gjSelect),
							shopping_id:this.infoObj.shopping_id,
							shopaid:this.shopaids,
							type:2,
							// type:  this.type == 'other' ? 11 : this.type == 'findCraftsman' ? 2 :  '' , //   11 其他 
							house_record_id:this.houseObj.id,
							have_check:this.popup.supervision,
							count:this.popup.num
						}
				var shoplengths = 1;
				console.log(shoplengths,'shoplengths')
				if(this.mode == 1){
					try{
						var res = await setShopCartAdd(params)
						uni.showToast({title:'添加成功,已在精算单内～',icon:'none'})
						this.$global.$editUploadBack(1,`actuarialSheet`)
						this.popup.supervision=  2
						this.popup.visible = false
						
						var pages = getCurrentPages();console.log(pages,'用户点击弹窗12');
						var page = pages[pages.length - 2].route;
						if(page != "pagesMy/order/actuarialSheet"){
							var page2 = pages[pages.length - 3].route;
							console.log(page2, '用户点击弹窗1332三');
						}
						console.log(page, '用户点击弹窗1332');
						
						
						if(this.source == 1){
							uni.showModal({
								title: '提示',
								content: '加入成功，是否返回精算单列表？',
								cancelText: '否',
								confirmText: '是',
								success: function (resss) {
									if (resss.confirm) {
										uni.showLoading({
										  mask: true,
										  title: '请稍后...'
										})
										// uni.redirectTo({
										// 	url: `/pagesMy/order/actuarialSheet`
										// });
										if(page == "pagesMy/order/actuarialSheet"){
											
											uni.navigateBack({
												delta: 1,
												complete: function (cg) {
													console.log(page2, '返回页面');
													uni.hideLoading()
												}
											});
										}else{
											if(page2 == "pagesMy/order/actuarialSheet"){
												
												uni.navigateBack({
													delta: 2,
													complete: function (cg) {
														console.log(page2, '返回页面');
														uni.hideLoading()
													}
												});
											}else if(page2 != "pagesMy/order/actuarialSheet"){
												
												uni.navigateBack({
													delta: 3,
													complete: function (cg) {
														console.log(page2, '返回页面2');
														uni.hideLoading()
													}
												});
											}
										}
									} else if (resss.cancel) {
										console.log('用户点击取消');
									}
								}
							});
						}
					}catch{}
				}else if(this.mode == 3){
					var pages = getCurrentPages();console.log(pages,'用户点击弹窗用户点击弹报价系统1');
					var page = pages[pages.length - 2].route;console.log(page, '用户点击弹窗用户点击弹报价系统2');
					if(page != "pagesServiceProvider/intersection/offerCurrent"){
						var page2 = pages[pages.length - 3].route;
						console.log(page2, '用户点击弹报价系统3');
					}
					
					
					
					if(this.offer == 2){
						let goods_sku_text = ''
						this.popup.gjSelect.forEach((c,ci)=>{
							if(ci == 0 &&  c != 0){
								goods_sku_text = '施工项目'+'：' + this.popup.gjInfo.gongyi[c-1].name + '；'
							}else if(c != 0){
								goods_sku_text += this.popup.gjInfo.cl_show[ci - 1].name + '：' + this.popup.gjInfo.cl_show[ci - 1].brand[c - 1].name+ '；'
							}
						})
						var info = { 
							amount: this.popup.gjMoneyAll,
							amount_one: this.popup.gjMoneyAll,
							count:1,
							goods_id:this.infoObj.id,
							goods_sku:goods_sku_text,
							id:this.type+this.infoObj.id,
							image:this.infoObj.cover,
							name:this.infoObj.name,
							params:params,
						}
						console.log(this.type,'报价type');
						console.log(this.infoObj.shop,'报价type2');
						console.log(info,'报价type3');
						this.$global.$chatOfferList(1,this.type,this.infoObj.shop,info)
						this.popup.supervision=  2
						this.popup.visible = false
						// this.$global.$chatPages()
						
						
						uni.showModal({
							title: '提示',
							content: '加入成功，是否返回报价表？',
							cancelText: '否',
							confirmText: '是',
							success: function (resss) {
								if (resss.confirm) {
									uni.showLoading({
									  mask: true,
									  title: '请稍后...'
									})
									// uni.redirectTo({
									// 	url: `/pagesMy/order/actuarialSheet`
									// });
									if(page == "pagesServiceProvider/intersection/offerCurrent"){
										
										uni.navigateBack({
											delta: 1,
											complete: function (cg) {
												console.log(page2, '返回页面');
												uni.hideLoading()
											}
										});
									}else{
										if(page2 == "pagesServiceProvider/intersection/offerCurrent"){
											
											uni.navigateBack({
												delta: 2,
												complete: function (cg) {
													console.log(page2, '返回页面');
													uni.hideLoading()
												}
											});
										}else if(page2 != "pagesServiceProvider/intersection/offerCurrent"){
											
											uni.navigateBack({
												delta: 3,
												complete: function (cg) {
													console.log(page2, '返回页面2');
													uni.hideLoading()
												}
											});
										}
									}
								} else if (resss.cancel) {
									console.log('用户点击取消');
								}
							}
						});
						
						return
					}
					try{
						var res = await setOfferAdd({...params,offer:1})
						uni.showToast({title:'已添加报价系统内～',icon:'none'})
						this.$global.$editUploadBack(1,`quotationSystem`)
						this.popup.supervision=  2
						this.popup.visible = false
						
						uni.showModal({
							title: '提示',
							content: '加入成功，是否返回报价表？',
							cancelText: '否',
							confirmText: '是',
							success: function (resss) {
								if (resss.confirm) {
									uni.showLoading({
									  mask: true,
									  title: '请稍后...'
									})
									// uni.redirectTo({
									// 	url: `/pagesMy/order/actuarialSheet`
									// });
									if(page == "pagesServiceProvider/intersection/offerCurrent"){
										
										uni.navigateBack({
											delta: 1,
											complete: function (cg) {
												console.log(page2, '返回页面');
												uni.hideLoading()
											}
										});
									}else{
										if(page2 == "pagesServiceProvider/intersection/offerCurrent"){
											
											uni.navigateBack({
												delta: 2,
												complete: function (cg) {
													console.log(page2, '返回页面');
													uni.hideLoading()
												}
											});
										}else if(page2 != "pagesServiceProvider/intersection/offerCurrent"){
											
											uni.navigateBack({
												delta: 3,
												complete: function (cg) {
													console.log(page2, '返回页面2');
													uni.hideLoading()
												}
											});
										}
									}
								} else if (resss.cancel) {
									console.log('用户点击取消');
								}
							}
						});
					}catch{}
				}else if(this.mode == 2){
					this.goodsname = '';
					this.popup.supervision=  2
					this.popup.visible = false
					uni.navigateTo({url:`/pagesMy/order/confirmOrder?type=commodity&info=${encodeURIComponent(JSON.stringify(params))}&shoplength=${shoplengths}`})
				}
			},
			onPop(x){
				if(this.goodssku == 1){
					uni.showToast({title:'档案地址不对，无法购买',icon:'none'})
				}
				//秒杀
				if(this.goumai == 1){
					uni.showToast({title:'当前商品秒杀活动未开始，请耐心等待',icon:'none'})
					return
				}
				if(this.goumai == 2){
					uni.showToast({title:'当前商品秒杀活动已结束',icon:'none'})
					return
				}
				//end
				if (!this.$store.getters.userInfo) {
					return this.$global.getUserInfo()
				}else if(!this.houseObj){
					uni.showToast({title:'请新房屋档案',icon:'none'})
					uni.navigateTo({
						url:'/pagesMy/housingArchives/detail?status=1'
					})
				}else{
					this.mode = x
					this.popup.visible = true
				}
				
			},
			async getSkuGJInfo(){
				try{
					var res = await gzGoodsSku({id:this.infoObj.id});
					var resH = null;
					this.popup.gjInfo = res;
					this.popup.gjSelect = [0,...res.cl_show.map(c=> 0)];
					this.popup.gjMoney = [0,...res.cl_show.map(c=> 0)];
					this.changeLabelGJ(1,0,this.popup.gjInfo.classify,0);
					console.log(this.popup.gjInfo,'工艺');
				}catch{}
			},
			onImg(){
				this.$global.onPreview(this.popup.sku && Object.keys(this.popup.sku).length > 0 &&  this.popup.sku['pic'] ? this.popup.sku['pic'] : this.infoObj && this.infoObj.carousel && this.infoObj.carousel.length > 0 ? this.infoObj.carousel[0] :'')
			},
			//跟个人聊天
			async onChatRoomgeren(id){
				if(!this.$store.getters.userInfo){
					return this.$global.getUserInfo()
				}
				this.infoObj.detailType = this.type
				this.infoObj.pageUrl = `/pagesCommodity/information?id=${this.type == 'decorationMoneyExchange' ? this.infoObj.fitment_id :  this.infoObj.id }&type=${this.type}`
				this.$store.commit('set_chat_commodityInfo',this.infoObj)
				this.chatLoading = true
				uni.showLoading({mask:true})
				try{
					var res = await getIMAccid({id,statustype:2})
					console.log(res,'在线聊天')
					console.log(this.$store.getters.userInfo.id,'在线聊天2')
					if(this.$store.getters.userInfo.id == res.id) return uni.showToast({title:'不能与自己聊天哦～',icon:'none'})
					this.$store.commit('set_chat_to',res)
					this.chatLoading = false
					uni.hideLoading()
					uni.navigateTo({
						url:'/pagesChat/chatRoom?char_type=1&shopping_id='+id+'&chat_toname='+res.name
					})
				}catch{
					this.chatLoading = false
					uni.hideLoading()
				}
				
			},
			//跟商家聊天
			async onChatRoom(id){
				if(!this.$store.getters.userInfo){
					return this.$global.getUserInfo()
				}
				if(this.chatLoading) return
				if(this.type == 'newHouseAcceptance' || this.type == 'thirdPartySupervision'){
					if(this.infoObj.im == 2) return uni.showToast({title:'当前区域暂不支持咨询，请联系客服'})
					if(this.$store.getters.userInfo.accid == this.infoObj.accid) return uni.showToast({title:'不能与自己聊天哦～',icon:'none'})
					this.infoObj.detailType = this.type
					this.infoObj.pageUrl = `/pagesHome/information?type=${this.type}`
					this.$store.commit('set_chat_commodityInfo',this.infoObj)
					this.$store.commit('set_chat_to',{avatar:this.infoObj.avatar,id:this.infoObj.accid,name:this.infoObj.name,shopping_id:id})
					uni.navigateTo({
						url:'/pagesChat/chatRoom?char_type=1&shopping_id='+id+'&chat_toname='+this.infoObj.name
					})
				}else{
					this.infoObj.detailType = this.type
					this.infoObj.pageUrl = `/pagesCommodity/information?id=${this.type == 'decorationMoneyExchange' ? this.infoObj.fitment_id :  this.infoObj.id }&type=${this.type}`
					this.$store.commit('set_chat_commodityInfo',this.infoObj)
					this.chatLoading = true
					uni.showLoading({mask:true})
					try{
						var res = await getIMAccid({id})
						if(this.$store.getters.userInfo.accid == res.id) return uni.showToast({title:'不能与自己聊天哦～',icon:'none'})
						this.$store.commit('set_chat_to',res)
						this.chatLoading = false
						uni.hideLoading()
						uni.navigateTo({
							url:'/pagesChat/chatRoom?char_type=1&shopping_id='+id+'&chat_toname='+res.name
						})
					}catch{
						this.chatLoading = false
						uni.hideLoading()
					}
				}
				
				
			},
			async onSave(){
				console.log(this.popup.label,'选项');
				console.log(this.popup.info.attrs,'选项3');
				
				if(this.popup.sku && Object.keys(this.popup.sku).length > 0 && this.popup.sku['stock'] == 0) return uni.showToast({title:'暂无库存，请联系店家！',icon:'none'})
				
				if(this.popup.label){
					if(this.popup.label.indexOf(null) != -1){
						uni.showToast({title:`请选择${this.popup.labelName[this.popup.label.indexOf(null)]}`,icon:'none'})
						return
					}
				}
				
				var goods_sku = {}
				if(this.popup.info.attrs){
					this.popup.info.attrs.forEach((v,vi)=>{
						let key = v['key']
						for(let b in this.popup.sku){
							if(b == key) goods_sku[key] = this.popup.sku[b]
						}
					})
				}
				var types = 0;
				if(this.type == 'newHouseAcceptance' ||  this.type ==  'thirdPartySupervision'){
					types = 11;
				}
				if(this.type == 'buildingMaterialsCity' && this.duihuanm == 1){
					types = 6;
				}
				if(this.type == 'buildingMaterialsCity' && this.duihuanm == 0){
					types = 10;
				}
				if(this.type == 'findDesign'){
					types = 1;
				}
				
				console.log(this.duihuanm,'商品详情页啊');
				if(this.type != 'marketingCampaign'){
					if(this.type == 'buildingMaterialsCity' && this.duihuanm == 1){
						var params = {
							amount:this.popup.gjMoneyAll,
							goods_id:this.infoObj.id,
							goods_sku:JSON.stringify(goods_sku),
							shopping_id:this.infoObj.shopping_id,
							shopaid:this.shopaids,
							price_ex:this.tc_ratio,
							type:  types,
							count:this.popup.num ,
							have_check:this.popup.supervision, //// newHouseAcceptance  thirdPartySupervision
						}
						var shoplengths = 1;
					}else{
						var params = {
							amount:this.popup.gjMoneyAll,
							goods_id:this.infoObj.id,
							goods_sku:JSON.stringify(goods_sku),
							shopping_id:this.infoObj.shopping_id,
							shopaid:this.shopaids,
							price_ex:this.tc_ratio,
							type:  types,
							count:this.popup.num ,
							have_check:this.popup.supervision, //// newHouseAcceptance  thirdPartySupervision
						}
						var shoplengths = 1;
					}
					
				}
				
				if(this.type == 'newHouseAcceptance' ||  this.type ==  'thirdPartySupervision'){
					params.is_new =  this.type == 'newHouseAcceptance'  ? 1 : 2 
					params.zone_id = this.$store.state.currentArea ? this.$store.state.currentArea.cityId : ''
					var shoplengths = 0;
				}
				if(this.type == 'decorationMoneyExchange') {
					params.fitment_id =  this.infoObj.fitment_id; 
					var shoplengths = 0; 
				}
				if(this.type == 'marketingCampaign'){
					var params = {
						id:this.infoObj.id,
						sku:JSON.stringify(goods_sku),
						amount:this.popup.gjMoneyAll,
						count:this.popup.num,
						shopaid:this.shopaids,
						price_ex:this.tc_ratio,
						marketingCampaign:true,
						type:this.infoObj.type
					}
					var shoplengths = 0;
				}
				
				
				console.log(params,'shoplengths');
				if(this.mode == 1){
					try{
						var res = await setShopCartAdd(params)
						uni.showToast({title:'添加成功,已在精算单内～',icon:'none'})
						this.$global.$editUploadBack(1,`actuarialSheet`)
						if(this.popup.info.attrs){
							this.popup.label = this.popup.info.attrs.map(c=> null)
						}else{
							this.popup.label = {};
						}
						
						this.popup.sku = {}
						this.popup.num = 1
						this.popup.supervision =  2
						this.popup.visible = false
						
						var pages = getCurrentPages();console.log(pages,'用户点击弹窗2');
						var page = pages[pages.length - 2].route;
						if(page != "pagesMy/order/actuarialSheet"){
							var page2 = pages[pages.length - 3].route;
							console.log(page,'用户点击弹窗332');
						}
						
						// var currentWebview = page.$getAppWebview();
						// console.log(currentWebview.id,'用户点击弹窗7');//获得当前webview的id
						// console.log(currentWebview.isVisible(),'用户点击弹窗8');//查询当前webview是否可见
						
						
						console.log(res,'用户点击弹窗6');
						if(this.source == 1){
							uni.showModal({
								title: '提示',
								content: '加入成功，是否返回精算单列表？',
								cancelText: '否',
								confirmText: '是',
								success: function (resss) {
									if (resss.confirm) {
										// uni.redirectTo({
										// 	url: `/pagesMy/order/actuarialSheet`
										// });
										uni.showLoading({
										  mask: true,
										  title: '请稍后...'
										})
										if(page == "pagesMy/order/actuarialSheet"){
											
											uni.navigateBack({
												delta: 1,
												complete: function (cg) {
													console.log(page2, '返回页面');
													uni.hideLoading()
												}
											});
										}else{
											if(page2 == "pagesMy/order/actuarialSheet"){
												
												uni.navigateBack({
													delta: 2,
													complete: function (cg) {
														console.log(page2, '返回页面');
														uni.hideLoading()
													}
												});
											}else if(page2 != "pagesMy/order/actuarialSheet"){
												
												uni.navigateBack({
													delta: 3,
													complete: function (cg) {
														console.log(page2, '返回页面2');
														uni.hideLoading()
													}
												});
											}
										}
									} else if (resss.cancel) {
										console.log('用户点击取消');
									}
								}
							});
						}
						
					}catch{}
				} else if(this.mode == 3){
					var pages = getCurrentPages();console.log(pages,'用户点击弹窗2报价系统1');
					var page = pages[pages.length - 2].route;console.log(page,'用户点击弹窗报价系统2');
					if(page != "pagesServiceProvider/intersection/offerCurrent"){
						var page2 = pages[pages.length - 3].route;
						console.log(page2,'用户点击弹窗报价系统22');
					}
					console.log(this.offer,'传过来的offer');
					if(this.offer == 2){
						let goods_sku_text = ''
						for(let c in goods_sku){
						   goods_sku_text += c + '：'+goods_sku[c]+'；'
						}
						console.log(this.popup.gjMoneyAll,'报价');
						var info = {
							// amount:this.type == 'findDesign' ? this.findDesignPrice : this.$global.formatFloat(this.popup.sku['price'],this.popup.num,3),
							amount:this.popup.gjMoneyAll,
							amount_one:this.popup.sku['price'],
							count:this.popup.num,
							// amount:this.gjMoneyAll,
							goods_id:this.infoObj.id,
							goods_sku:goods_sku_text,
							id:this.type+this.infoObj.id,
							image:this.infoObj.cover,
							name:this.infoObj.name,
							params:params
						}
						console.log(this.type,'报价啊啊');
						console.log(this.infoObj,'报价啊啊type2');
						if(this.type == 'buildingMaterialsCity'){
							console.log(this.infoObj.shop.build_city_id,'报价啊啊啊');
							
							console.log(info,'报价啊啊type3');
							var fasid = this.infoObj.shop.build_city_id+2;
							console.log(fasid,'报价啊啊typ4');
							if(fasid == 1){
								this.infoObj.shop.build_city_id = 1;
							}else if(fasid == 2){
								this.infoObj.shop.build_city_id = 2;
							}
							else if(fasid == 3){
								this.infoObj.shop.build_city_id = 8;
							}
							else if(fasid == 4){
								this.infoObj.shop.build_city_id = 7;
							}
							else if(fasid == 5){
								this.infoObj.shop.build_city_id = 6;
							}
							else if(fasid == 6){
								this.infoObj.shop.build_city_id = 5;
							}
							else if(fasid == 7){
								this.infoObj.shop.build_city_id = 4;
							}
							else if(fasid == 8){
								this.infoObj.shop.build_city_id = 3;
							}
							else if(fasid == 9){
								this.infoObj.shop.build_city_id = 2;
							}
							else if(fasid == 10){
								this.infoObj.shop.build_city_id = 1;
							}
							console.log(this.infoObj.shop.build_city_id,'报价啊啊啊2');
							this.$global.$chatOfferList(1,this.infoObj.shop.build_city_id,this.infoObj.shop,info)
						}else{
							this.$global.$chatOfferList(1,this.type,this.infoObj.shop,info)
						}
						
						if(this.popup.info.attrs){
							this.popup.label = this.popup.info.attrs.map(c=> null)
						}else{
							this.popup.label = {};
						}
						this.popup.sku = {}
						this.popup.num = 1
						this.popup.supervision=  2
						this.popup.visible = false
						// this.$global.$chatPages()
						
						uni.showModal({
							title: '提示',
							content: '加入成功，是否返回报价表？',
							cancelText: '否',
							confirmText: '是',
							success: function (resss) {
								if (resss.confirm) {
									uni.showLoading({
									  mask: true,
									  title: '请稍后...'
									})
									// uni.redirectTo({
									// 	url: `/pagesMy/order/actuarialSheet`
									// });
									if(page == "pagesServiceProvider/intersection/offerCurrent"){
										
										uni.navigateBack({
											delta: 1,
											complete: function (cg) {
												console.log(page, '返回页面1');
												uni.hideLoading()
											}
										});
									}else{
										if(page2 == "pagesServiceProvider/intersection/offerCurrent"){
											
											uni.navigateBack({
												delta: 2,
												complete: function (cg) {
													console.log(page2, '返回页面');
													uni.hideLoading()
												}
											});
										}else if(page2 != "pagesServiceProvider/intersection/offerCurrent"){
											
											uni.navigateBack({
												delta: 3,
												complete: function (cg) {
													console.log(page2, '返回页面2');
													uni.hideLoading()
												}
											});
										}
									}
									
								} else if (resss.cancel) {
									console.log('用户点击取消');
								}
							}
						});
						return
					}
					try{
						var res = await setOfferAdd({...params,offer:1})
						uni.showToast({title:'已添加报价系统内～',icon:'none'})
						this.$global.$editUploadBack(1,`quotationSystem`)
						if(this.popup.info.attrs){
							this.popup.label = this.popup.info.attrs.map(c=> null)
						}else{
							this.popup.label = {};
						}
						this.popup.sku = {}
						this.popup.num = 1
						this.popup.supervision=  2
						this.popup.visible = false
						console.log('添加成功');
						uni.showModal({
							title: '提示',
							content: '加入成功，是否返回报价表？',
							cancelText: '否',
							confirmText: '是',
							success: function (resss) {
								if (resss.confirm) {
									uni.showLoading({
									  mask: true,
									  title: '请稍后...'
									})
									// uni.redirectTo({
									// 	url: `/pagesMy/order/actuarialSheet`
									// });
									if(page == "pagesServiceProvider/intersection/offerCurrent"){
										
										uni.navigateBack({
											delta: 1,
											complete: function (cg) {
												console.log(page, '返回页面');
												uni.hideLoading()
											}
										});
									}else{
										if(page2 == "pagesServiceProvider/intersection/offerCurrent"){
											
											uni.navigateBack({
												delta: 2,
												complete: function (cg) {
													console.log(page2, '返回页面');
													uni.hideLoading()
												}
											});
										}else if(page2 != "pagesServiceProvider/intersection/offerCurrent"){
											
											uni.navigateBack({
												delta: 3,
												complete: function (cg) {
													console.log(page2, '返回页面2');
													uni.hideLoading()
												}
											});
										}
									}
								} else if (resss.cancel) {
									console.log('用户点击取消');
								}
							}
						});
					}catch{}
				}else if(this.mode == 2){
					if(this.popup.info.attrs){
						this.popup.label = this.popup.info.attrs.map(c=> null)
					}else{
						this.popup.label = '';
					}
					
					this.popup.sku = {};
					this.popup.num = 1;
					this.popup.supervision=  2;
					this.popup.visible = false;
					var money = 0;
					
					if(this.type == 'findCraftsman'){
						this.popup.gjMoney.forEach((c,i)=>{
							console.log(this.popup.gjMoney,'选择性aaaaf阿斯蒂芬 ');
							money = this.$global.formatFloat(money,Number(c),1)
						})
					}else{
						if(this.xuanxiang == 1){
							if(this.popup.sku.price){
								money = this.$global.formatFloat(money,Number(this.popup.sku.price),1)
							}
							
							// this.popup.info.sku.forEach((c,i)=>{
							// 	money = this.$global.formatFloat(money,Number(c.price),1)
							// })
						}else if(this.xuanxiang == 2){
							money = this.infoObj['amount_x']
						}
						
					}
					
					this.popup.gjMoneyAll = money;
					this.goodsname = '';
					this.availableIntegraC = 0;
					this.tc_ratio = 0;
					uni.navigateTo({url:`/pagesMy/order/confirmOrder?type=commodity&fitment_id=${this.type == 'decorationMoneyExchange' ? this.infoObj.fitment_id : ''}&info=${encodeURIComponent(JSON.stringify(params))}&shoplength=${shoplengths}`})
				}
			},
			changeLabel(row,i,label,il){
				
				// console.log(this.popup.info.sku,'啊4');
				// console.log(row,'啊41');
				// console.log(i,'啊42');
				// console.log(label,'啊43');
				// console.log(il,'啊44');
				this.popup.label[i] = label
				this.popup.row[i] = row
				// console.log(this.popup.label,'啊45');
				// console.log(this.popup.row,'啊46');
				if(this.popup.label.indexOf(null) == -1){
					this.popup.info.sku.forEach((c,ci)=>{ //{}
						let length = 0
						let lengths = 0
						let goddsname = '';
						
						
						// console.log(c,'啊15');console.log(ci,'啊25');
						this.popup.info.attrs.forEach((v,vi)=>{
							let key = v['key']
							// console.log(v,'啊14');console.log(vi,'啊24');
							for(let b in c){
								//判断类目名称相等的情况下在判断类目值相等
								if(b == this.popup.row[vi]){
									if(c[b] == this.popup.label[vi]){
										goddsname = goddsname+c[b]+' ';
										lengths ++
									}
								}
								
								// if(key == b && c[b] && c[b] == this.popup.label[vi]){
								// 	goddsname = goddsname+c[b]+',';
								// }
								// if(c[b] && c[b] == this.popup.label[vi])  length ++ 
							}
							
							
						})
						// console.log(lengths,'而我认为有');
						// if(length == this.popup.label.length) return this.popup.sku = c
						if(lengths == this.popup.label.length){
							
							this.goodsname = goddsname;
							
							this.popup.sku = c
							// console.log(this.popup.sku,'啊666');
						}
					})
				}
				
				
				
				setTimeout(()=>{
					var money = 0
					// this.popup.sku.forEach((c,i)=>{
					// 	console.log(c,'选择性');
						if(this.popup.sku.price){
							
							// var configAvailableIntegra = this.integralProportion &&  c.config && c.config.ratio && v.have_check == 1 ? this.$global.formatFloat(this.$global.formatFloat(c.config.ratio * 0.01 , v.check_amount,3), this.integralProportion,4) : 0
							// this.availableIntegra = this.$global.formatFloat(v.availableIntegraC,v.configAvailableIntegra,1)
							
							
							money = this.$global.formatFloat(money,Number(this.popup.sku.price),1)
							if(this.type == 'buildingMaterialsCity' || this.type == 'decorationMoneyExchange'){
								this.availableIntegraC = this.$global.formatFloat(this.$global.formatFloat(this.infoObj.ratio * 0.01 , money,3),this.popup.num,3);
								
							}
							this.tc_ratio = this.$global.formatFloat(this.popup.sku.tc_ratio,this.popup.num,3);
							// console.log(this.popup.num,'预计可得1');
							// console.log(this.popup.sku.tc_ratio,'预计可得2');
							// console.log(this.tc_ratio,'预计可得');console.log(this.popup.sku,'预计可得4');
						}
						
					// })
					
					// console.log(this.tc_ratio,'啊51');
					// console.log(this.yunshops,'啊52');
					// console.log(this.infoObj.type,'啊53');
					// this.popup.gjMoneyAll = this.$global.formatFloat(money,this.houseObj.centiare,3)
					this.popup.gjMoneyAll = this.$global.formatFloat(money,this.popup.num,3)   //20220223修改
					// this.popup.gjMoneyAll = money
					this.$forceUpdate()
				})
				// this.$forceUpdate()
			},
			changeLabelGJ(x,i,row,key){
				if(!this.houseObj) return uni.showToast({title:'请选择房屋',icon:'none'})
				var ic = x == 1 ? [i]  : i.split('_').map(c=>Number(c))
				
				if(x == 1){
					if(this.popup.gjSelect[0] == 0){
						this.popup.gjMoney[0] = row.amount[0]
						this.popup.gjSelect[0] = i + 1
						
						this.goddname[0] = row.name;
					}else{
						this.popup.gjMoney[0] = 0
						this.popup.gjSelect[0] = 0
						
						this.goddname[0] ='';
					}
				}else{
					if(this.popup.gjSelect[ic[0]+1] == ic[1]+1){
						this.popup.gjMoney[ic[0]+1] = 0
						this.popup.gjSelect[ic[0]+1] = 0
						
						this.goddname[ic[0]+1] = '';
					}else{
						this.popup.gjMoney[ic[0]+1] = row.amount
						this.popup.gjSelect[ic[0]+1] = ic[1]+1
						
						this.goddname[ic[0]+1] = row.name;
					}
				}
				
				console.log(x,'啊1');
				console.log(i,'啊2');
				console.log(row,'啊3');
				console.log(this.goddname.toString(),'啊4');
				
				this.goodsname = this.goddname.toString();
				console.log(this.popup.gjMoney,'默认选择 ');
				// return this.popup.gjMoney.reduce((totalPrice, v) => totalPrice + v.amount, 0)
				setTimeout(()=>{
					var money = 0
					this.popup.gjMoney.forEach((c,i)=>{
						money = this.$global.formatFloat(money,Number(c),1)
					})
					
					if(this.duihuan == 1){
						this.availableIntegraC = this.$global.formatFloat(this.$global.formatFloat(this.infoObj.ratio * 0.01 , money,3),this.popup.num,3);
						console.log(this.availableIntegraC,'装修金抵扣');
					}
					
					// this.popup.gjMoneyAll = this.$global.formatFloat(money,this.houseObj.centiare,3)
					this.popup.gjMoneyAll = this.$global.formatFloat(money,this.popup.num,3)   //20220223修改
					// this.popup.gjMoneyAll = money
					this.$forceUpdate()
				})
			},
			changeSupervision(){
				if(this.type == 'findCraftsman') return
				this.popup.supervision = this.popup.supervision == 1 ? 2 : 1
			},
			changeNum(type){
				// if(this.popup.sku && Object.keys(this.popup.sku).length > 0 && this.popup.sku['stock'] == 0) return
				if(type == 1){
					if(this.popup.num > 1){
						this.popup.num --
					}
				}else{
					if(type == 3 && this.popup.num < 1) this.popup.num = 1 
					if(type == 2 ) this.popup.num ++ 
					if(this.popup.sku && Object.keys(this.popup.sku).length > 0 && this.popup.sku.hasOwnProperty('stock') && this.popup.sku['stock'] > 0){
						if(this.popup.num > this.popup.sku['stock']) this.popup.num =  this.popup.sku['stock']
					}
					if(this.popup.num <= 0) this.popup.num = 1
				}
				
				//20220223修改
				var money = 0
				
				if(this.type == 'findCraftsman'){
					this.popup.gjMoney.forEach((c,i)=>{
						console.log(this.popup.gjMoney,'选择性aaaaf阿斯蒂芬 ');
						money = this.$global.formatFloat(money,Number(c),1)
					})
				}else{
					if(this.xuanxiang == 1){
						if(this.popup.sku.price){
							money = this.$global.formatFloat(money,Number(this.popup.sku.price),1)
							this.tc_ratio = this.$global.formatFloat(this.popup.sku.tc_ratio,this.popup.num,3);
						}
						
						// this.popup.info.sku.forEach((c,i)=>{
						// 	money = this.$global.formatFloat(money,Number(c.price),1)
						// })
					}else if(this.xuanxiang == 2){
						money = this.infoObj['amount_x']
						this.tc_ratio = this.$global.formatFloat(this.infoObj.tc_ratio,this.popup.num,3);
					}
					
				}
				if(this.type == 'buildingMaterialsCity'){
					this.availableIntegraC = this.$global.formatFloat(this.$global.formatFloat(this.infoObj.ratio * 0.01 , money,3),this.popup.num,3);
					
					console.log(this.availableIntegraC,'装修金抵扣');
				}
				if(this.type == 'findCraftsman' && this.duihuan == 1){
					this.availableIntegraC = this.$global.formatFloat(this.$global.formatFloat(this.infoObj.ratio * 0.01 , money,3),this.popup.num,3);
					console.log(this.availableIntegraC,'装修金抵扣');
				}
				
				// this.popup.gjMoneyAll = this.$global.formatFloat(money*this.houseObj.centiare,this.popup.num,3)   
				this.popup.gjMoneyAll = this.$global.formatFloat(money,this.popup.num,3) //20220223修改
			},
		},
	}
</script>

<style lang="scss" scoped>
	.youhui{
		background-color: #ff5555;
		    color: #ffffff;
		    font-size: 12px;
		    width: 100%;
		    display: inline;
		    padding: 2px 10px;
		    border-radius: 4px;
	}
	.red{
		color:#ff0000;
	}
	.popup_box{
		position: relative;
		width: 750rpx;
		height: 80vh;
		border-radius: 20rpx 20rpx 0  0;
		overflow: hidden;
		padding: 48rpx 32rpx 32rpx 32rpx;
		box-sizing: border-box;
		.specifications{
			width: 100%;
			padding: 20rpx 0 150rpx ;
			height: calc(80vh - 292rpx) ;
			box-sizing: border-box;
			.list{
				.row{
					padding-bottom: 22rpx;
					border-bottom: 2rpx solid #f4f4f4;
					padding-top: 36rpx;
					&:first-child{
						padding-top: 6rpx;
					}
					.title{
						font-size: 26rpx;
						line-height: 33rpx;
						color:#333;
					}
					.label{
						.text{
							display: inline-block;
							padding: 12rpx 20rpx;
							background: #f5f6f7;
							border-radius: 8rpx;
							line-height: 34rpx;
							color:#999999;
							font-size: 24rpx;
							margin-right: 44rpx;
							margin-top: 16rpx;
							position: relative;
						}
						image{
							width: 28rpx;
							height: 28rpx;
							margin-left: 20rpx;
						}
						.active{
							background-color: $theme;
							color:#fff;
						}
						.stock{
							position:absolute;
							right: -20rpx;
							top:-20rpx;
							padding: 5rpx;
							font-size: 24rpx;
							transform: scale(0.8);
							background: #999999;
							color:#fff;
							border-radius:10rpx
						}
					}
				}
			}
			.supervision{
				padding: 32rpx 0;
				width: 100%;
				display: flex;
				justify-content: space-between;
				align-items: cenetr;
				.left{
					display: flex;
					align-items: center;
					font-size: 26rpx;
					line-height: 36rpx;
					colora:#333;
					image{
						width: 28rpx;
						height: 28rpx;
						margin-left: 20rpx;
					}
				}
				.right{
					width: calc(100% - 300rpx);
					display: flex;
					justify-content: flex-end;
					align-items: center;
					.money{
						display: inline-block;
						font-size: 30rpx;
						line-height: 44rpx;
						color:#333333;
						margin-right: 20rpx;
					}
				}
			}
			.num_box{
					border-bottom: 2rpx solid #f4f4f4;
					padding:28rpx 5rpx 22rpx 0 ;
					display: flex;
					width: 100%;
					box-sizing: border-box;
					justify-content: space-between;
					align-items: center;
					.left{
						font-size: 26rpx;
						line-height: 36rpx;
						color:#333333;
					}
					.right{
						width: calc(100% - 6em);
						text-align: right;
						display: flex;
						align-items: center;
						justify-content: flex-end;
						.text{
							text-align: center;
							display: inline-block;
							width: 64rpx;
							height: 58rpx;
							background: #f7f8f9;
							border-radius: 4rpx;
							line-height: 58rpx;
							color:#999999;
							font-size: 24rpx;
						}
						.text2{
							text-align: center;
							width: 76rpx;
							height: 58rpx;
							line-height: 58rpx;
							background: #f0f1f2;
							border-radius: 4rpx;
							color:#333;
							font-size: 32rpx;
							margin: 0 4rpx;
						}
					}
					.right_d{
						.text,.text2{
							opacity: 0.6;
						}
					}
				}
			
		}
		.icon{
			position: absolute;
			right: 32rpx;
			top:30rpx;
		}
		.top_box{
			display: flex;
			justify-content: space-between;
			width: 100%;
			height: 230rpx;
			padding-bottom: 22rpx;
			border-bottom: 2rpx solid #f4f4f4;
			.left{
				image{
					width: 188rpx;
					height: 188rpx;
				}
			}
			.right{
				width: calc(100% - 208rpx);
				.text1{
					padding-top: 20rpx;
					font-size: 28rpx;
					color:#FB0C1B;
					line-height: 40rpx;
				}
				.text2{
					margin-top: 10rpx;
					font-size: 24rpx;
					color:#999999;
					line-height: 34rpx;
				}
				.jijiadanwei{
					font-size: 13px;
					margin-top: 10rpx;
				}
			}
		}
		.button_box{
			background-color: #fff;
			position: absolute;
			z-index: 99;
			bottom: 0;
			left: 0;
			padding: 30rpx 32rpx;
			width: 750rpx;
			box-sizing: border-box;
			.btn{
				width: 100%;
				height: 82rpx;
				background: $theme;
				border-radius: 42rpx;
				font-size: 32rpx;
				color:#fff;
			}
			button{
				width: 100%;
				height: 82rpx;
				background: $theme;
				border-radius: 42rpx;
				font-size: 32rpx;
				color:#fff;
			}
			.btn_d{
				opacity:0.6;
			}
		}
		
	}
	.house{
		display: flex;
		justify-content: space-between;
		padding: 20rpx 0;
		color:#26252A;
		font-size: 24rpx;
		.left{
			width: 5em;
			line-height: 40rpx;
		}
		.right{
			display: flex;
			justify-content: space-between;
			align-items: center;
			width: calc(100% - 6em);
			.text{
				text-align: right;
				width: calc(100% - 40rpx);
			}
			.text2{
				color:#999;
			}
			
		}
	}
	.bottom_box_offer{
		position: fixed;
		z-index: 9;
		bottom: 0;
		width: 750rpx;
		padding: 26rpx 14rpx 20rpx 36rpx;
		width: 100%;
		box-sizing: border-box;
		background-color: #fff;
		display: flex;
		align-items: center;
		justify-content: center;
		.btn{
			width: 80%;
			height: 70rpx;
			line-height: 70rpx;
			background: $theme;
			color:#FFFFFF;
			font-size: 26rpx;
			border-radius: 36rpx;
		}
	}
	.bottom_box{
		position: fixed;
		bottom: 0;
		z-index: 9;
		width: 750rpx;
		padding: 26rpx 14rpx 20rpx 36rpx;
		width: 100%;
		box-sizing: border-box;
		background-color: #fff;
		display: flex;
		justify-content: space-between;
		.left{
			width: calc(100% - 500rpx);
			display: flex;
			.row{
				display: flex;
				flex-direction: column;
				align-items: center;
				&:first-child{
					margin-right: 30rpx;
				}
			}
			image{
				width: 40rpx;
				height: 40rpx;
				margin-bottom: 10rpx;
			}
			text{
				font-size: 20rpx;
				line-height: 28rpx;
				color:#ADADAD;
			}
		}
		.left2{
			width: calc(100% - 600rpx);
		}
		.right{
			.btn1{
				display: inline-block;
				width: 240rpx;
				height: 72rpx;
				line-height: 72rpx;
				background: #FDAC74;
				color:#26252A;
				font-size: 24rpx;
				border-radius: 36rpx 0rpx 0rpx 36rpx;
			}
			.btn2{
				display: inline-block;
				width: 240rpx;
				height: 72rpx;
				line-height: 72rpx;
				background: $theme;
				color:#fff;
				font-size: 24rpx;
				border-radius: 0rpx 36rpx 36rpx 0rpx;
			}
			.btn3{
				display: inline-block;
				width: 560rpx;
				height: 72rpx;
				line-height: 72rpx;
				background: $theme;
				color:#fff;
				font-size: 24rpx;
				border-radius: 36rpx;
			}
		}
	}
	button[loading]::before{
		align-self:center
	}
	button{
		display: flex;
		justify-content: center;
		align-item:center;
		padding: 0;
		border: 0;
	}
	button::after{
		border: none;
	}
</style>
